package day03;

import java.util.Random;

public class ArrayTest4 {
    public static void main(String[] args) {        //打乱数组
        int[] arr = {1,2,3,4,5};
        Random r = new Random();
        for(int i=0;i<100;i++){
            int i1=r.nextInt(5);
            int i2=r.nextInt(5);
            int temp=arr[i1];
            arr[i1]=arr[i2];
            arr[i2]=temp;
        }
        for(int i=0;i<arr.length;i++){
            System.out.print(arr[i]+" ");
        }
    }
}
